Total Complexity | 1 |
Total Lines | 30 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | import React from 'react'; |
||
6 | |||
7 | export class SideNav extends React.PureComponent { |
||
8 | static propTypes = { |
||
9 | className: PropTypes.string, |
||
10 | func: PropTypes.func, |
||
11 | list: PropTypes.arrayOf( |
||
12 | PropTypes.shape({ |
||
13 | id: PropTypes.string, |
||
14 | value: PropTypes.string, |
||
15 | }), |
||
16 | ), |
||
17 | }; |
||
18 | |||
19 | static defaultProps = {}; |
||
20 | |||
21 | render() { |
||
22 | const { className, list } = this.props; |
||
23 | const { func } = this.props; |
||
24 | return ( |
||
25 | <ul className={className}> |
||
26 | {list.map(item => ( |
||
27 | <li key={item.id}> |
||
28 | <BasicButton |
||
29 | className="navButton" |
||
30 | func={() => func(item.id)} |
||
31 | text={item.value} |
||
32 | /> |
||
33 | </li> |
||
34 | ))} |
||
35 | </ul> |
||
36 | ); |
||
56 |